﻿ CREATE proc [dbo].[danhmucMaSoThue_sua] --'5001','hgfj'      
@MaSoThue varchar(25),        
@TenKH nvarchar(200),
@MaSoThueMoi varchar(25)     
as        
if exists(select * from DM_MSThue  Where MaSoThue=@MaSoThueMoi and masothue <> @MaSoThue   )  
begin  
select ErrCode=0  
end  
else  
begin  
update DM_MSThue    set TenKH=@TenKH   
  
  Where MaSoThue=@MaSoThue 
select ErrCode=1  
end